<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>发表评论</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" href="css/StyleSheet.css" type="text/css" />
	</head>

	<body style="padding-bottom: 30px;">
		<div style="font-weight: bold; font-size: 20px;">
			<span style="color: #9d958f">
        	<label for="" id="lblTitle"></label>
        </span>
		</div>
		<img src="Images/timeicon.gif" />
		<label for="" id="lblDateModified">2012-02-02 12:12:12</label>
		<img src="Images/author.gif" />
		<label for="" id="lblName">魏文銮</label>
		<p>
			&nbsp;
		</p>
		<label for="" id="lblContent" class="contentColor"></label>
		<br />
		<a href="" id="hlkComments" class="sumColor">评论数（1）</a>
		<a href="" id="hlkClicks" class="sumColor">点击数（3）</a>
		<!-- comment list-->
		<span class="contentColor">#1楼
                	2014-4-4 12:12:20
                | 
                	匿名用户
                <br />
                	垃圾
                <hr />
            </span>
		<form>

			<div id="divAddComment">
				<a name="commentform" class="sumColor">评论</a>
				<br />
				<textarea name="txtComment" id="txtComment" Style="width: 400px; height: 120px" value=""></textarea>
				<br />
				<div style="display:none;" class="isShow">
					<input type="checkbox" name="" id="chkIsAnonymity" value="" style="color: #006600;" /><label for="chkIsAnonymity" style="font-size: 12px;">&nbsp;匿名评论</label>
				</div>
			</div>
			<input type="submit" name="bntSubmit" id="bntSubmit" value="提交评论" class="opt_sub" />
		</form>
		<script type="text/javascript">
			function checkbox() {
				var txtComment = document.getElementById("txtComment");
				var contentStr = txtComment.value;
				if(contentStr.length < 5) {
					alert("输入的评论内容不能小于5个字。");
					return false;
				} else {
					var keyword = ["混蛋", "王八蛋"];
					for(var i = 0; i < keyword.length; i++) {
						if(contentStr.indexOf(keyword[i]) != -1) {
							alert("输入的评论内容不能有违规内容。");
							return false;
						}
					}
				}
			}
			window.onload = function() {
				document.forms[0].onsubmit = function() {
					return checkbox();
				}
			};
		</script>
	</body>
</html>
